package com.mallcai.bigdata.ladon.dpl.entity.system;

import com.mallcai.bigdata.ladon.dpl.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author gst
 * @date 2019-12-30 20:36
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class UserSession extends BaseEntity {
    /**
     * 用户Id
     */
    private Long    userId;
    /**
     * 会话token
     */
    private String  token;
    /**
     * 登录时间
     */
    private Long    loginTime;
    /**
     * 超时时间(分钟)
     */
    private Integer timeout = 30;

    public UserSession(Long userId, String token) {
        this.userId = userId;
        this.token = token;
    }

    public UserSession(Long userId, String token, Integer timeout) {
        this.userId = userId;
        this.token = token;
        this.timeout = timeout;
    }
}
